1. Field of the Invention
The present invention relates to a central processing unit (CPU) and to a microcomputer incorporating the CPU, peripheral circuits, and a function of testing the peripheral circuits.
2. Description of the Prior Art
Microcomputers are used in various fields. To satisfy a variety of user requirements, many kinds of microcomputers must be developed.
One of the methods to provide a microcomputer that meets user requirements is a megacell method. This method stores layouts of function blocks such as CPUs, memories, timers, and serial interfaces in a computer database. Necessary function blocks are picked up from the database and arranged to form the connection diagram and mask data of a microcomputer. In addition to the function blocks, logic gate arrays are arranged in the microcomputer according to user requirements.
This method is capable of developing a customized microcomputer in a short time. The customized microcomputer must be efficiently and correctly simulated and tested.
To test peripheral function blocks in the customized microcomputer, a test program having machine-language instructions is executed by a CPU of the microcomputer.
FIG. 1 shows a method of testing peripheral function blocks of a customized microcomputer according to a prior art.
The microcomputer 101 has a CPU 102 and peripheral function blocks. The function blocks include peripheral function macros 103 and 104 and a memory macro 105. These elements are connected to one another through an address bus 106, a data bus 107, and a control signal group 108.
The CPU 102 works in synchronization with a clock signal provided to a clock terminal 109. The microcomputer 101 is reset by a reset signal provided to a reset terminal 112. The function macros 103 and 104 have external terminals 110 and 111, respectively, serving as interfaces with respect to external devices.
The CPU 102 executes instructions stored in the memory macro 105, to test the write and read operations of the function macros 103 and 104 through the data bus 107.
Namely, the CPU 102 runs a test program having machine-language instructions proper for the CPU. The CPUs frequently employ different machine-language instructions, and therefore, different test programs must be prepared for CPUs of different kinds.
For a CPU involving simple operations, test vectors are manually prepared. For a CPU involving complicated operations, test vectors are prepared through simulations with an operation model of the CPU. It is difficult to form a correct operation model of a CPU involving complicated operations and large-scale circuits.
Simulating the operation of a large-scale CPU with a model takes a long time to deteriorate testing efficiency.
The user of a customized microcomputer must simulate the operation thereof by himself. In this case, the manufacturer of the microcomputer must provide the user with information about the internal structure of the CPU that must be concealed from the user.
Japanese Laid-Open Patent No. 2-289999 discloses a method of testing an internal memory of a microcomputer. This disclosure employs a unit for connecting some of the external terminals of peripheral function macros to internal data and address buses, to write and read data to and from the internal memory.
This technique provides the internal memory with control signals through the external terminals during a test. This technique tests only the internal memory and is incapable of testing a connection between a CPU and the memory.
Accordingly, to test the connection between the CPU and the memory, it is necessary to employ a function of the CPU, to thereby raise the problem of preparing an operation model of the CPU as mentioned above.